package com.wy.ssm01.service.impl;


import com.wy.ssm01.entity.Member;
import com.wy.ssm01.mapper.MemberMapper;
import com.wy.ssm01.mapper.RoleMapper;
import com.wy.ssm01.service.MemberService;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class MemberServiceImpl implements MemberService {
@Autowired
    private MemberMapper memberMapper;
    @Autowired
    private RoleMapper roleMap;
    
    @Override
    public List<Member> queryAll() {
        return memberMapper.queryAll();
    }

    @Override
    public int insert(Member member) {

        return memberMapper.insert(member);

    }

    @Override
    public List<Member> queryAll2() {
        return memberMapper.queryAll2();
    }

    public static void main(String[] args) {
        MemberServiceImpl memberService = new MemberServiceImpl();
        Map<String, String> hashMap = new HashMap<>();
//        hashMap.put("upass","111");
       hashMap.put("uname","222_2");
        Member query = memberService.memberMapper.query(hashMap);
        System.out.println(query);
        //query.forEach(System.out::println);
/*
        MemberServiceImpl memberService = new MemberServiceImpl();
        List<Member> members = memberService.queryAll2();
        members.forEach(System.out::println);
        System.out.println(memberService.roleMap.queryById(2));
*/
    }
}
